USE [QLDL]
GO

/****** Object:  StoredProcedure [dbo].[sp_SuaThongTinQuan]    Script Date: 01/03/2011 15:28:34 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create procedure [dbo].[sp_SuaThongTinQuan]
	@MaQuan nvarchar(10), @SoDLToiDa int
as
begin
	declare @SoDL int
	select @SoDL = COUNT(*) from DAILY where MaQuan = @MaQuan
	
	if (@SoDLToiDa < @SoDL)
		return 1
	
	update QUAN set SoDLToiDa = @SoDLToiDa where MaQuan = @MaQuan 
	return 0
end
GO


